
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import { $http } from '@escook/request-miniprogram' //导入网络请求包

uni.$http = $http

$http.baseUrl = 'https://api-hmugo-web.itheima.net'	//请求根路径
$http.beforeRequest = function(options){	
	uni.showLoading({
		title:'数据加载中...'
	})
}
$http.afterRequest = function(){	//响应拦截器
	uni.hideLoading()
}

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
import { $http } from '@escook/request-miniprogram'

// 2. 挂载到 uni 全局对象（和 Vue2 保持一致）
uni.$http = $http

// 3. 配置根路径和拦截器
$http.baseUrl = 'https://api-hmugo-web.itheima.net'
$http.beforeRequest = (options) => {
  uni.showLoading({ title: '数据加载中...' })
}
$http.afterRequest = () => {
  uni.hideLoading()
}

export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif